
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

char u_buf[128] = {0};
int main(int argc, const char *argv[])
{
    /*your code*/
    int fd;
    fd = open("/dev/leddev", O_RDWR);
    if (fd < 0) {
        perror("open");
        return -1;
    }
    while(1) {
        u_buf[0] = 1;
        u_buf[1] = 1;
        write(fd, u_buf, sizeof(u_buf));
        sleep(1);
        u_buf[1] = 0;
        write(fd, u_buf, sizeof(u_buf));
        sleep(1);
    }
    close(fd);
    return 0;
}